package form.ui.Effect
{
	import flash.filters.GlowFilter;
	
	import form.utils.MathUtils;
	
	public class Glow extends Interpolate
	{
		private var glowFilter:GlowFilter;
		
		public function Glow()
		{
			super();
			glowFilter = new GlowFilter(0xFFFFFF, 1, 0, 0, 2);
		}
		
		public function get glow():Number { return this.value; }
		
		public function set startGlow(value:Number):void { this.startValue = value; } 
		public function get startGlow():Number { return this.startValue; }
		
		public function set stopGlow(value:Number):void { this.stopValue = value; } 
		public function get stopGlow():Number { return this.stopValue; }
		
		protected override function draw(interval:uint = 0):void 
		{
			glowFilter.blurX = glowFilter.blurY = this.glow;
			if(this.target)this.target.filters = [glowFilter];
		}
		
		 public override function start():void 
		{
			if(this.target)this.target.filters = [glowFilter];
			super.start();
		}
		
		public override function stop():void 
		{
			if(this.target)this.target.filters = [];
			super.stop();
		} 
	}
}